<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_details', function (Blueprint $table) {
            $table->id();
            $table->string('wx_group')->default('')->comment('微信结算群');
            $table->string('distance_price')->default('')->comment('价格区间');
            $table->integer('plateform_id')->default(0)->comment('平台类型id');
            $table->integer('shop_id')->default(0)->comment('店铺id');
            $table->integer('template_id')->default(0)->comment('模板id');
            $table->integer('department_id')->default(0)->comment('部门id');
            $table->string('shop_name')->default('')->comment('商店名称');
            $table->string('template_name')->default('')->comment('模板名称');
            $table->string('store_category')->default('')->comment('店铺类目');

            $table->timestamp('trial_connection_start')->nullable()->comment('试接起始时间');
            $table->timestamp('trial_connection_end')->nullable()->comment('试接终止时间');
            $table->longText('shop_materials')->default('')->comment('店铺资料');
            $table->tinyInteger('cooperation_status')->default(1)->comment('状态1正常2终止');
            $table->dateTime('breakup_time')->nullable()->comment('终止合作时间');
            $table->integer('customer_id')->default(0)->comment('客户id');
            $table->timestamps();
            $table->integer('department_one_id')->default(0)->comment('一级部门id');
            $table->integer('department_two_id')->default(0)->comment('二级部门id');
            $table->integer('department_three_id')->default(0)->comment('三级部门id');
            $table->dateTime('reassign_time')->nullable()->comment('重新分配时间');

        });
        \DB::statement("ALTER TABLE `shop_details` comment '店铺详情'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_details');
    }
};
